package com.yun.algorithmproblem.leetcode;

public class Leetcode2270 {

    public int waysToSplitArray(int[] nums) {
        long total=0;
        for (int num : nums) {
            total+=num;
        }
        int ans=0;
        long curr=0;
        for (int i = 0; i < nums.length-1; i++) {
            curr+=nums[i];
            if(curr*2>=total){
                ans++;
            }
        }
        return ans;
    }
}
